package Day4_07_26;

/**
 * 2、int[] scores={0,0,1,2,3,5,4,5,2,8,7,6,9,5,4,8,3,1,0,2,4,8,7,9,5,2,1,2,3,9};
 * 要求求出其中的奇数个数和偶数个数。
 */
public class Num2 {
	public static void main(String[] args) {
		int[] scores = { 0, 0, 1, 2, 3, 5, 4, 5, 2, 8, 7, 6, 9, 5, 4, 8, 3, 1, 0, 2, 4, 8, 7, 9, 5, 2, 1, 2, 3, 9 };
		int oddCount = 0, evenCount = 0;
		for (int i = 0; i < scores.length; i++) {
			if (scores[i] % 2 != 0) {
				oddCount += 1;
			} else {
				evenCount += 1;
			}
		}
		System.out.println("奇数出现的个数：" + oddCount);
		System.out.println("偶数出现的个数：" + evenCount);
	}
}
